#!/bin/bash

set -e

# Check version in https://docs.projectcalico.org/v3.8/manifests/calico.yaml

CALICO_VERSION=v3.8.2

CALICO_URL=calico
CUSTOM_URL=caoy83/calico

images=(node:${CALICO_VERSION}
cni:${CALICO_VERSION}
pod2daemon-flexvol:${CALICO_VERSION}
kube-controllers:${CALICO_VERSION})


for imageName in ${images[@]} ; do
  docker pull $CUSTOM_URL-$imageName
  docker tag  $CUSTOM_URL-$imageName $CALICO_URL/$imageName
  docker rmi  $CUSTOM_URL-$imageName
done

docker images